/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-06-20 22:20:14
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-21 20:05:19
 * @FilePath: \shangyitong\src\api\home\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import service from "@/utils/request";
import type { HosptiaResponse, HospitalLevelAndRegionArrResoponse, HospitalInfo } from './type'
//同一管理首页模块接口
enum API {
    //获取医院的数据展示
    HOSPITAL_URL = "/hosp/hospital",//  /hosp/hospital/1/10'
    //获取医院的等级和地区 的接口
    HOSPITALLEVELANDREGION_URL = "/cmn/dict/findByDictCode", ///cmn/dict/findByDictCode/{dictCode}
    //根据具医院名称获取医院列表
    HOSPITALINFO_URL = "/hosp/hospital/findByHosname"///hosp/hosptial/findByHosname/{hosnmae}
}

//获取医院的数据的请求方法
export const reqHospital = (pageNo: number, limit: number, hospType = "", districtCode = "") => service.get<any, HosptiaResponse>(API.HOSPITAL_URL + `/${pageNo}/${limit}?hostype=${hospType}&districtCode=${districtCode}`)
//获取医院的等级和地区 的方法
export const reqHospitalLevelAndRegion = (dictCode: string) => service.get<any, HospitalLevelAndRegionArrResoponse>(API.HOSPITALLEVELANDREGION_URL + `/${dictCode}`)
//根据医院的名字获取医院数据
export const reqHospitalInfo = (hosname: string) => service.get<any, HospitalInfo>(API.HOSPITALINFO_URL + `/${hosname}`)